package com.mingqijia.gassafety.webserver.response;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;


/**
 * @author guoliang.lao
 * @version 1.0.0
 * @ClassName LatestLogListRequest.java
 * @Description 实时状态详情返回
 * @createTime 2022年02月21日
 */
@Data
public class LatestLogDetailResponse {

    @ApiModelProperty("设备ID")
    private String equipmentId;

    @ApiModelProperty("设备号")
    private String imei;

    @ApiModelProperty("设备厂商")
    private String equipmentManufacturer;

    @ApiModelProperty("设备类型")
    private String equipmentType;

    @ApiModelProperty("设备类型名称")
    private String equipmentTypeName;

    @ApiModelProperty("设备型号")
    private String equipmentModel;

    @ApiModelProperty("检测类型")
    private String detectionType;

    @ApiModelProperty("设备名称")
    private String equipmentName;

    @ApiModelProperty("设备状态 0:离线 1:正常 2:低报 3:高报 4:故障 5:过期")
    private Integer equipmentStatus;

    @ApiModelProperty("设备位置")
    private String installationPosition;

    @ApiModelProperty("气体浓度")
    private String xlel;

    @ApiModelProperty("信号情况")
    private Integer signal;

    @ApiModelProperty("最近一次上报时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date latestTime;

    @ApiModelProperty("运营商")
    private String operators;

    @ApiModelProperty("通讯方式")
    private String communicationMode;

    @ApiModelProperty("关联【气体报警控制器】信息(点型气体探测器详情返回数据)")
    private GasController gasController = new GasController();

    @ApiModelProperty("客户Id")
    private Integer consumerId;

    @ApiModelProperty("客户名称")
    private String consumerName;

    @ApiModelProperty("所属行业")
    private String industryType;

    @ApiModelProperty("所属行业名")
    private String industryTypeName;

    @ApiModelProperty("户名")
    private String custName;

    @ApiModelProperty(value = "燃气公司")
    private String companyName;

    @ApiModelProperty("户号")
    private String subsCode;

    @ApiModelProperty("户址")
    private String custAddress;

    @ApiModelProperty("户主手机号")
    private String custPhone;

    @ApiModelProperty("气户状态")
    private String custStatus;

    @ApiModelProperty("户主 用户类型")
    private String custType;

    @ApiModelProperty("经度")
    private Double positionLon;

    @ApiModelProperty("纬度")
    private Double positionLat;

    @ApiModelProperty("更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;

    @ApiModelProperty("备注")
    private String remark;

    @ApiModelProperty("点位")
    private Integer point;

    @ApiModelProperty("电池电压")
    private Double btV;

    @ApiModelProperty("联系人信息")
    List<Contact> contactList = new ArrayList<>();

    @ApiModelProperty(value = "设备来源：0：默认 1：紫荆wifi设备")
    @TableField("equipment_from")
    private Integer equipmentFrom;

    @ApiModelProperty("点位设备信息(气体报警控制器的详情返回数据)")
    List<Equipment> equipmentList = new ArrayList<>();

    @ApiModelProperty(value = "紫荆设备编号")
    private String deviceNo;

    @ApiModelProperty(value = "联机码")
    private String onlineCode;

    @ApiModelProperty(value = "设备是否带有接收器和电磁阀")
    private Boolean withReceiver;

    @ApiModelProperty(value = "接收器编号")
    private String receiverCode;

    @ApiModelProperty(value = "接收器类型 市电款 电池款")
    private String receiverType;

    @ApiModelProperty(value = "供电方式")
    private String receiverPowerMode;

    @ApiModelProperty(value = "紫荆系统工作天数")
    private String workingDays;

    @ApiModelProperty(value = "接收器工作信息")
    private String receiverWorkingInfo;

    @ApiModelProperty(value = "阀门工作信息")
    private String valveWorkingInfo;

    @ApiModelProperty("电磁阀id")
    private String valveId;

    @ApiModelProperty("用户id")
    private String memberId;

    @ApiModelProperty("用户手机号")
    private String memberPhone;

    @ApiModelProperty("联系人姓名")
    private String contactName;

    @ApiModelProperty("联系人手机号")
    private String contactPhone;

    @ApiModelProperty("联系人地址")
    private String contactAddress;

    @ApiModelProperty(value = "安装地址")
    private String installationAddress;

    @ApiModelProperty(value = "设备上是否有电磁阀,与紫荆设备无关")
    private String hasValve;

    @ApiModelProperty(value = "电磁阀名称")
    private String valveName;

    @ApiModelProperty(value = "电磁阀型号")
    private String valveModel;

    @ApiModelProperty(value = "电磁阀材质")
    private String valveMaterial;

    @ApiModelProperty(value = "电磁阀厂家")
    private String valveManufacturer;

    @ApiModelProperty(value = "电磁阀有效期 年")
    private Integer valveValidity;

    @ApiModelProperty(value = "客户地址")
    private String customerAddress;

    @ApiModelProperty(value = "设备检定时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8")
    private Date verificationTime;

    @ApiModelProperty(value = "功能区域")
    private ConsumerFuncAreaResponse funcArea;


    /**
     * 点型气体探测器返回数据
     * 关联【气体报警控制器】信息
     */
    @Data
    public class GasController {
        @ApiModelProperty("设备ID")
        private String equipmentId;

        @ApiModelProperty("设备号")
        private String iMEI;

        @ApiModelProperty("设备厂商")
        private String equipmentManufacturer = "";

        @ApiModelProperty("设备类型")
        private String equipmentType;

        @ApiModelProperty("设备类型名称")
        private String equipmentTypeName = "";

        @ApiModelProperty("设备型号")
        private String equipmentModel = "";

        @ApiModelProperty("运营商")
        private String operators = "";

        @ApiModelProperty("通讯方式")
        private String communicationMode = "";

        @ApiModelProperty("设备名称")
        private String equipmentName = "";

        @ApiModelProperty("设备位置")
        private String installationPosition = "";

        @ApiModelProperty("信号情况")
        private Integer signal;

        @ApiModelProperty("最近一次上报时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date latestTime;

        @ApiModelProperty("电池电压")
        private Double btV;

        @ApiModelProperty("设备状态 0:离线 1:正常 2:低报 3:高报 4:故障 5:过期")
        private Integer equipmentStatus;

        @ApiModelProperty(value = "安装地址")
        private String installationAddress;

        @ApiModelProperty(value = "安装纬度")
        private Double positionLat;

        @ApiModelProperty(value = "安装经度")
        private Double positionLon;

        @ApiModelProperty(value = "设备上是否有电磁阀,与紫荆设备无关")
        private String hasValve;

        @ApiModelProperty(value = "电磁阀名称")
        private String valveName;

        @ApiModelProperty(value = "电磁阀型号")
        private String valveModel;

        @ApiModelProperty(value = "电磁阀材质")
        private String valveMaterial;

        @ApiModelProperty(value = "电磁阀厂家")
        private String valveManufacturer;

        @ApiModelProperty(value = "电磁阀有效期 年")
        private Integer valveValidity;
    }

    @Data
    public static class Contact {
        @ApiModelProperty("联系人姓名")
        private String contactName;

        @ApiModelProperty("手机号码")
        private String telephone;

        @ApiModelProperty("人员级别")
        private Integer level;

        @ApiModelProperty("人员级别名")
        private String levelName;

        @ApiModelProperty("备注")
        private String remark;
    }

    /**
     * 气体报警控制器的详情返回数据
     * 点位设备信息
     */
    @Data
    public static class Equipment {
        @ApiModelProperty("设备号")
        private String imei;

        @ApiModelProperty("设备名称")
        private String equipmentName;

        @ApiModelProperty("安装位置")
        private String installationPosition;

        @ApiModelProperty("设备状态 0:离线 1:正常 2:低报 3:高报 4:故障 5:过期")
        private Integer equipmentStatus;

        @ApiModelProperty("气体浓度")
        private String xlel;

        @ApiModelProperty(value = "电磁阀名称")
        private String valveName;

        @ApiModelProperty(value = "电磁阀型号")
        private String valveModel;

        @ApiModelProperty(value = "电磁阀材质")
        private String valveMaterial;

        @ApiModelProperty(value = "电磁阀厂家")
        private String valveManufacturer;

        @ApiModelProperty(value = "电磁阀有效期 年")
        private Integer valveValidity;

    }
}
